package com.hxzy.consumer;

import com.hxzy.message.Demo01Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

/**
 * @Author wy
 * @Description TODO
 * @Date 2023/10/17 14:49
 * @Version 1.0
 */

@Component
public class Demo01TopicSinkConsumer {
    private Logger logger = LoggerFactory.getLogger(getClass());

    @StreamListener(value = "demo01-input")
    public void onMessage(@Payload Demo01Message message) {
        logger.info("[onMessage][线程编号:{} 消息内容：{}]", Thread.currentThread().getId(), message);
    }

}
